
<h1><span class="yiyi-st" id="yiyi-12">numpy.arctan</span></h1>
        <blockquote>
        <p>原文：<a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.arctan.html">https://docs.scipy.org/doc/numpy/reference/generated/numpy.arctan.html</a></p>
        <p>译者：<a href="https://github.com/wizardforcel">飞龙</a> <a href="http://usyiyi.cn/">UsyiyiCN</a></p>
        <p>校对：（虚位以待）</p>
        </blockquote>
    
<dl class="data">
<dt id="numpy.arctan"><span class="yiyi-st" id="yiyi-13"> <code class="descclassname">numpy.</code><code class="descname">arctan</code><span class="sig-paren">(</span><em>x</em><span class="optional">[</span>, <em>out</em><span class="optional">]</span><span class="sig-paren">)</span><em class="property"> = &lt;ufunc &apos;arctan&apos;&gt;</em></span></dt>
<dd><p><span class="yiyi-st" id="yiyi-14">三角反正切，元素。</span></p>
<p><span class="yiyi-st" id="yiyi-15">因此，如果<code class="docutils literal"><span class="pre">y</span> <span class="pre">=</span> <span class="pre">tan（x）</span></code>则<code class="docutils literal"><span class="pre">x </span> <span class="pre">=</span> <span class="pre">arctan（y）</span></code>。</span></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name">
<col class="field-body">
<tbody valign="top">
<tr class="field-odd field"><th class="field-name"><span class="yiyi-st" id="yiyi-16">参数：</span></th><td class="field-body"><p class="first"><span class="yiyi-st" id="yiyi-17"><strong>x</strong>：array_like</span></p>
<blockquote>
<div><p><span class="yiyi-st" id="yiyi-18">输入值。</span><span class="yiyi-st" id="yiyi-19"><a class="reference internal" href="#numpy.arctan" title="numpy.arctan"><code class="xref py py-obj docutils literal"><span class="pre">arctan</span></code></a>应用于<em class="xref py py-obj">x</em>的每个元素。</span></p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name"><span class="yiyi-st" id="yiyi-20">返回：</span></th><td class="field-body"><p class="first"><span class="yiyi-st" id="yiyi-21"><strong>out</strong>：ndarray</span></p>
<blockquote class="last">
<div><p><span class="yiyi-st" id="yiyi-22">Out具有与<em class="xref py py-obj">x</em>相同的形状。</span><span class="yiyi-st" id="yiyi-23">Its real part is in <code class="docutils literal"><span class="pre">[-pi/2,</span> <span class="pre">pi/2]</span></code> (<code class="docutils literal"><span class="pre">arctan(+/-inf)</span></code> returns <code class="docutils literal"><span class="pre">+/-pi/2</span></code>). </span><span class="yiyi-st" id="yiyi-24">如果<em class="xref py py-obj">x</em>是标量，它是一个标量。</span></p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title"><span class="yiyi-st" id="yiyi-25">也可以看看</span></p>
<dl class="last docutils">
<dt><span class="yiyi-st" id="yiyi-26"><a class="reference internal" href="numpy.arctan2.html#numpy.arctan2" title="numpy.arctan2"><code class="xref py py-obj docutils literal"><span class="pre">arctan2</span></code></a></span></dt>
<dd><span class="yiyi-st" id="yiyi-27">由（<em class="xref py py-obj">x</em>，<em class="xref py py-obj">y</em>）和正的<em class="xref py py-obj">x</em>轴形成的角度的“四象限”</span></dd>
<dt><span class="yiyi-st" id="yiyi-28"><a class="reference internal" href="numpy.angle.html#numpy.angle" title="numpy.angle"><code class="xref py py-obj docutils literal"><span class="pre">angle</span></code></a></span></dt>
<dd><span class="yiyi-st" id="yiyi-29">复杂值的论证。</span></dd>
</dl>
</div>
<p class="rubric"><span class="yiyi-st" id="yiyi-30">笔记</span></p>
<p><span class="yiyi-st" id="yiyi-31"><a class="reference internal" href="#numpy.arctan" title="numpy.arctan"><code class="xref py py-obj docutils literal"><span class="pre">arctan</span></code></a> is a multi-valued function: for each <em class="xref py py-obj">x</em> there are infinitely many numbers <em class="xref py py-obj">z</em> such that tan(<em class="xref py py-obj">z</em>) = <em class="xref py py-obj">x</em>. </span><span class="yiyi-st" id="yiyi-32">惯例是返回其实部在[-pi / 2，pi / 2]中的角度<em class="xref py py-obj">z</em>。</span></p>
<p><span class="yiyi-st" id="yiyi-33">对于实值输入数据类型，<a class="reference internal" href="#numpy.arctan" title="numpy.arctan"><code class="xref py py-obj docutils literal"><span class="pre">arctan</span></code></a>始终返回实际输出。</span><span class="yiyi-st" id="yiyi-34">对于不能表示为实数或无穷大的每个值，它会产生<code class="docutils literal"><span class="pre">nan</span></code>并设置<em class="xref py py-obj">无效</em>浮点错误标志。</span></p>
<p><span class="yiyi-st" id="yiyi-35">对于复值输入，<a class="reference internal" href="#numpy.arctan" title="numpy.arctan"><code class="xref py py-obj docutils literal"><span class="pre">arctan</span></code></a>是具有[<em class="xref py py-obj">1j，infj</em>]和[<em class="xref py py-obj">-1j，-infj</em>]的复杂分析函数切口，并且从前面的左边和后面的右边是连续的。</span></p>
<p><span class="yiyi-st" id="yiyi-36">反正切也称为<em class="xref py py-obj">atan</em>或tan ^ { -  1}。</span></p>
<p class="rubric"><span class="yiyi-st" id="yiyi-37">参考文献</span></p>
<p><span class="yiyi-st" id="yiyi-38">Abramowitz，M。和Stegun，I。</span><span class="yiyi-st" id="yiyi-39">A.，<em>Handbook of Mathematical Functions</em>，第10次印刷，New York：Dover，1964，</span><span class="yiyi-st" id="yiyi-40">79. <a class="reference external" href="http://www.math.sfu.ca/~cbm/aands/">http://www.math.sfu.ca/~cbm/aands/</a></span></p>
<p class="rubric"><span class="yiyi-st" id="yiyi-41">例子</span></p>
<p><span class="yiyi-st" id="yiyi-42">我们期望0的arctan为0，并且1的arctan为pi / 4：</span></p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">arctan</span><span class="p">([</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">])</span>
<span class="go">array([ 0.        ,  0.78539816])</span>
</pre></div>
</div>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">np</span><span class="o">.</span><span class="n">pi</span><span class="o">/</span><span class="mi">4</span>
<span class="go">0.78539816339744828</span>
</pre></div>
</div>
<p><span class="yiyi-st" id="yiyi-43">绘图arctan：</span></p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plt</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">linspace</span><span class="p">(</span><span class="o">-</span><span class="mi">10</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">plt</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">arctan</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">plt</span><span class="o">.</span><span class="n">axis</span><span class="p">(</span><span class="s1">&apos;tight&apos;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">plt</span><span class="o">.</span><span class="n">show</span><span class="p">()</span>
</pre></div>
</div>
<p><span class="yiyi-st" id="yiyi-44">（<a class="reference external" href="../../reference/generated/numpy-arctan-1.py">源代码</a>，<a class="reference external" href="../../reference/generated/numpy-arctan-1.png">png</a>，<a class="reference external" href="../../reference/generated/numpy-arctan-1.pdf">pdf</a>）</span></p>
<div class="figure">
<img alt="../../_images/numpy-arctan-1.png" src="../../_images/numpy-arctan-1.png">
</div>
</dd></dl>
